﻿#region 참조 네임스페이스

using System.IO;

#endregion

namespace Skying.IO
{
	/// <summary>
	/// <see cref="System.IO.Directory"/> 클래스의 Static 확장 메서드를 제공한다.
	/// </summary>
	public static class DirectoryHelper
	{
		/// <summary>
		/// 디렉토리 경로 상의 하위 디렉토리들의 <see cref="System.IO.DirectoryInfo"/>
		/// </summary>
		/// <param name="directoryPath"></param>
		/// <returns></returns>
		public static DirectoryInfo[] GetDirectoryInfos(string directoryPath)
		{
			return GetDirectoryInfos(Directory.GetDirectories(directoryPath));
		}

		/// <summary>
		/// 디렉토리 경로 목록으로부터 <see cref="System.IO.DirectoryInfo"/> 배열을 얻는다.
		/// </summary>
		/// <param name="directoryPaths">디렉토리 경로 목록을 설정한다.</param>
		/// <returns><see cref="System.IO.DirectoryInfo"/> 배열이 반환된다.</returns>
		public static DirectoryInfo[] GetDirectoryInfos(string[] directoryPaths)
		{
			DirectoryInfo[] directoryInfos = new DirectoryInfo[directoryPaths.Length];

			for (int index = 0; index < directoryPaths.Length; index++)
			{
				directoryInfos[index] = new DirectoryInfo(directoryPaths[index]);
			}

			return directoryInfos;
		}
	}
}